Binds multiple cache fields to events, all represented as an associative array
Binding keys:
event - name of the event the field is binded to
id - cache object id
realm - cache realm name
type - cache storage type, one of COT_CACHE_TYPE_* constants
Page cache driver.
Is FALSE if page cache is disabled
system\cache.php at line 1173
resync_on_exit
private bool $resync_on_exit = false
A flag to apply binding changes before termination
system\cache.php at line 1178
selected_drv
private string $selected_drv = ''
Selected memory driver
Constructor Detail
system\cache.php at line 1183
__construct
public void __construct()
Initializes Page cache for early page caching
Method Detail
system\cache.php at line 1206
__get
public mixed __get(string name)
Property handler
Parameters:
name - Property name
Returns:
Property value
system\cache.php at line 1227
init
public void init()
Initializes the rest Cache components when the sources are available
system\cache.php at line 1275
resync_bindings
private void resync_bindings()
Rereads bindings from database
system\cache.php at line 1296
bind
public bool bind(string event, string id, string realm, int type)
Binds an event to automatic cache field invalidation
Parameters:
event - Event name
id - Cache entry id
realm - Cache realm name
type - Storage type, one of COT_CACHE_TYPE_* values
Returns:
TRUE on success, FALSE on error
system\cache.php at line 1323
bind_array
public int bind_array(array bindings)
Binds multiple cache fields to events, all represented as an associative array
Binding keys:
event - name of the event the field is binded to
id - cache object id
realm - cache realm name
type - cache storage type, one of COT_CACHE_TYPE_* constants
Parameters:
bindings - An indexed array of bindings. Each binding is an associative array with keys: event, realm, id, type.
Returns:
Number of bindings added
system\cache.php at line 1352
clear
public bool clear(int type)
Clears all cache entries
Parameters:
type - Cache storage type: COT_CACHE_TYPE_ALL, COT_CACHE_TYPE_DB, COT_CACHE_TYPE_DISK, COT_CACHE_TYPE_MEMORY.
Returns:
system\cache.php at line 1393
clear_realm
public void clear_realm(string realm, int type)
Clears cache in specific realm
Parameters:
realm - Realm name
type - Cache storage type: COT_CACHE_TYPE_ALL, COT_CACHE_TYPE_DB, COT_CACHE_TYPE_DISK, COT_CACHE_TYPE_MEMORY.
system\cache.php at line 1431
get_info
public array get_info()
Returns information about memory driver usage
Returns:
Usage information
system\cache.php at line 1448
trigger
public int trigger(string event)
Invalidates cache cells which were binded to the event.
Parameters:
event - Event name
Returns:
Number of cells cleaned
system\cache.php at line 1497
unbind
public int unbind(string realm, string id)
Removes event/cache bindings
Parameters:
realm - Realm name (required)
id - Object identifier. Optional, if not specified, all bindings from the realm are removed.